<%@ page language="java" contentType="text/html; charset=UTF-8" import="java.util.*,SiTuQingYou.vo.*,SiTuQingYou.util.*"
    pageEncoding="UTF-8"%>
<%String path = request.getContextPath();%>
<!DOCTYPE html>
<html>
<script type="text/javascript" src="<%=path %>/houtai/js/jquery-3.3.1.min.js"></script>
	<head>
	
		<meta charset="UTF-8">
		<title></title>
		
	    <link rel="stylesheet" href="<%=path %>/houtai/res/css/amazeui.min.css">
		<link rel="stylesheet" href="<%=path %>/houtai/res/css/admin.css">
		<link rel="stylesheet" href="<%=path %>/houtai/res/css/app.css">
	</head>
	<style>
	   #a{ width:200px;height:40px;color:lightseagreen;}
	   .pager a{display:inline-block; width:40px;height:40px;background-color:lightgray;text-align:center;line-height:40px;border-radius:18px;text-decoration:none;margin-top:10px;}
	   .pager a.cur{background-color:#E0FFFF;}
	   img{width:72px;height:72px;}
	   .daoyou{width:100%;height:72px;margin:10px;background-color:#E0FFFF;font-weight:bold;}	   
	   .head{width:72px;height:72px;float:left;}	   
	   .guidername{width:100px;height:70px;line-height:70px;float:left;margin-left:10px;}
	   .guidersex{width:50px;height:70px;line-height:70px;float:left;margin-left:10px;}
	   .guideridnum{width:200px;height:70px;line-height:70px;float:left;margin-left:10px;}
	   .guiderphone{width:160px;height:70px;line-height:70px;float:left;margin-left:10px;}
	   .guiderprice{width:100px;height:70px;line-height:70px;float:left;margin-left:10px;}
	   .guiderinfo{width:300px;height:70px;line-height:70px;float:left;overflow:auto;margin-left:10px;}
	   .pager{width:100%;height:70px;line-height:70px;text-align:center;font-weight:bold;}
	   
	    #boxes{width:100%;height:72px;background-color:#E0FFFF;font-weight:bold;text-align:center;}
	    #box1{float:left;text-align:left;width:72px;height:70px;line-height:70px;margin-left:10px;text-align:center;}
	    #box2{float:left;text-align:left;width:100px;height:70px;line-height:70px;margin-left:10px;}
	    #box3{float:left;text-align:left;width:50px;height:70px;line-height:70px;margin-left:10px;}
	    #box4{float:left;text-align:left;width:200px;height:70px;line-height:70px;margin-left:10px;}
	    #box5{float:left;text-align:left;width:300px;height:70px;line-height:70px;margin-left:10px;}
	    #box6{float:left;text-align:left;width:160px;height:70px;line-height:70px;margin-left:10px;}
	    #box7{float:left;text-align:left;width:120px;height:70px;line-height:70px;margin-left:10px;}
	    .shanchu,.xiugai{text-decoration:none;display:inline-block;cursor:pointer;}
	    
	    #clearfloat{clear:left;width:1400px;}
	</style>
	<body>
	  <div id="clearfloat">
	    <!-- 页面固有信息 -->
		<div class="admin-content-body">
			<div class="am-cf am-padding am-padding-bottom-0">
				<div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">思途轻游管理</strong><small></small></div>
			</div>
			<hr>

			<div class="am-g">
				<div class="am-u-sm-12 am-u-md-6">
					<div class="am-btn-toolbar">
						<div class="am-btn-group am-btn-group-xs">
							<button type="button" class="am-btn am-btn-default addGuider"><span class="am-icon-plus"></span> 添加导游</button>
						</div>
					</div>
				</div>
				<div class="am-u-sm-12 am-u-md-3">

				</div>
				<div class="am-u-sm-12 am-u-md-3">
				<div class="am-input-group am-input-group-sm">
           				 <form  method="post" action="<%=path%>/houtai/checkallgui.jsp">
						       <input type="text" name="key" >
						        <input type="submit" value="搜索">
						       </form>  
					</div>
				</div>
			</div>
	
			<div class="am-g">
				<div class="am-u-sm-12"></div>
            </div>
		</div>
		
		<!-- 显示导游界面 -->
		<div id="guiderlist">
		     <jsp:include page="/GuiderServlet"><jsp:param value="lookForAllGuiders" name="method"/></jsp:include>
		<%
		ArrayList<Guider> allGuider =(ArrayList<Guider>)request.getAttribute("allGuider");
		Pager pager = (Pager)request.getAttribute("pager");
		%>
		<div id="boxes">
			<div id="box1">头像</div>
			<div id="box2">姓名</div>
			<div id="box3">性别</div>
			<div id="box4">身份证号</div>
			<div id="box6">手机号</div>
			<div id="box2">导游费/天</div>
			<div id="box5">个人简介</div>
			<div id="box2">所属城市</div>
			<div id="box7">操作</div>
		</div>
		<%
		    for(Guider g:allGuider){
		%>
		    <div class="daoyou">
		         <!-- 头像 -->
		         <div class="head"><img src="<%=path%>/GuiderHead/<%=g.getGuiderphoto()%>"></div>
		          
		         <!-- 导游姓名 -->
		         <div class="guidername"><%=g.getGuidername() %></div>
		         
		         <%
		         String str="";
		         	if(g.isGuidersex()==true)
		         	{
		         		str="男";
		         	}
		         	else
		         	{
		         		str="女";
		         	}
		         %>
		         <!-- 性别 -->
		         <div class="guidersex"><%=str %></div>
		         
		         
		         <!-- 身份证号 -->
		         <div class="guideridnum"><%=g.getGuideridnumber() %></div>
		         
		         <!-- 手机号 -->
		         <div class="guiderphone"><%=g.getGuiderphone() %></div>
		         
		         <!-- 导游费 -->
		         <div class="guiderprice"><%=g.getGuiderprice() %></div>
		         
		         <!-- 导游信息 -->
		         <div class="guiderinfo"><%=g.getGuiderinfo() %></div>
		         <!--  所属城市-->
		         <div class="guidername"><%=g.getCity().getCityname() %></div>
		         <!-- 操作 -->
		         <div class="control">
		         <a class="xiugai" id="<%=g.getId()%>" v="<%=g.getId()%>">修改</a>
		         <a class="shanchu" id="delete" href="javascript:if(confirm('确定删除此导游吗?'))location='<%=path %>/GuiderServlet?method=deleteOneGuider&id=<%=g.getId() %>'" >删除</a>
		         </div>
		    
		    </div>
		 <%} %>   
		    <!-- 显示页码 -->
         <div class="pager">
           <%
           for(int i=1;i<=pager.getPageCount();i++)
           {%>
              <a href="<%=path%>/houtai/newsType.jsp?pageNum=<%=i%>" class=<%=(i==pager.getPageNum()?"cur":"")%>><%=i%></a>
           
          <%}%>
               <font>共<%=pager.getPageCount() %>页   共<%=pager.getDataCount() %>条记录</font>
         </div>
		    
		    
		</div>

		
		<script type="text/javascript" src="<%=path %>/houtai/myplugs/js/plugs.js"></script>
		<script type="text/javascript">
		$(".addGuider").click(function() {
					$.jq_Panel({
						title: "添加导游信息",
						iframeWidth: 500,
						iframeHeight: 400,
						url: "AddGuiderPage.jsp",
					});
				});
		$(".xiugai").click(function() {
			var v = $(this).attr("v");
			$.jq_Panel({
				title: "修改信息",
				iframeWidth: 500,
				iframeHeight: 400,
				url: "amendGuider.jsp?info="+v,
				
			});
		});
		
	     </script>
	     
	    </div>
	</body>

</html>